package cn.wp.ewallet.common.dao.impl;

import cn.wp.common.core.dao.JdbcSupportTemplate;
import cn.wp.common.core.dao.SqlString;

import cn.wp.ewallet.common.dao.PubLanguageInfoDao;
import cn.wp.ewallet.common.extension.constant.EwalletConstant;
import cn.wp.ewallet.common.model.entity.PubLanguageInfoDo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 语言信息数据访问层 数据访问层实现
 * Created by ganjie1 on 2019/10/23
 */
@Repository
public class PubLanguageInfoDaoImpl implements PubLanguageInfoDao {

    @Autowired
    private JdbcSupportTemplate jdbcSupportTemplate;

    @Override
    public List<PubLanguageInfoDo> selectLanguageInfoList() {
        SqlString sqlString = SqlString.newInstance();
        sqlString.add("select a.*");
        sqlString.add("from PUB_LANGUAGE_INFO a");
        sqlString.add("        where a.IS_SHOW = ?");
        Object[] params=new Object[]{
                 EwalletConstant.STATUS
        };
        return jdbcSupportTemplate.selectList(sqlString.build(), params, PubLanguageInfoDo.class);
    }
}